// ImageLoader.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "ImageLoader.h"
#include "voimage.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
		case DLL_PROCESS_DETACH:
			break;
    }
    return TRUE;
}

HBITMAP LoadBitmapFromResource (HDC hdc, DWORD dwResourceID, LPCTSTR pcszClass, HMODULE hModule)
{
	HBITMAP hBitmap = NULL;
	CVOImage image;
	BOOL success = image.SetBitmap ( hdc, dwResourceID, pcszClass, hModule );

	if (success)
	{
		hBitmap = image.m_hbitmap;
	}

	return hBitmap;
}

HBITMAP LoadBitmapFromFilename (HDC hdc, LPCTSTR szFileName)
{
	HBITMAP hBitmap = NULL;
	CVOImage image;
	BOOL success = image.Load ( hdc, szFileName );

	if (success)
	{
		hBitmap = image.m_hbitmap;
	}

	return hBitmap;
}

